<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>程闻</title>
</head>
<script>
    function getzb(e) {
        var x=e.clientX;
        var y=e.clientY;
        var res=document.getElementById("result");
        res.innerText="<h2>坐标:x="+x+" y="+y+"</h2>";
    }
   function test() {
       var res=document.getElementById("result");
       res.innerHTML="";
   }

</script>
<body>
<P>坐标</P>
<div id="zb" style= "width:300px ;height:300px;border: 1px  solid #88ff67;"
    onmousemove="getzb(event);"
     onmouseout="test();">
</div>
<div id="result"></div>
</body>
</html>